<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="jypath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html >
<html  lang="en">
<head>
    <meta charset="utf-8">
    <title>修改组团</title>
    <%@include file="../../common/operation_forbid.jsp" %>
    <%@include file="../../common/jsVersion.jsp" %>
    <link href="${jypath}/static/optimization/css/bootstrap.min.css" rel="stylesheet" />
    <link href="${jypath}/resources/css/upload.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="${jypath}/static/css/strip.css" />
 	<script src="${jypath}/resources/js/jquery.min.js" type="text/javascript"></script>
	<!-- layer弹窗插件-->
	<script src="${jypath}/static/plugins/layer/2.1/layer.js"></script>
	<script src="${jypath}/resources/js/ajaxfileupload.js" type="text/javascript"></script>
	<script src="${jypath}/static/js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<style type="text/css">
		table.table>thead>tr>th{vertical-align: middle;text-align: center;}
	</style>
</head>
<body>
<form id="premises_form">
<div class="loadinfor">
	<div class="maintt">基本信息<a class="power open"></a></div>
	<div class="editetablewrap"> 
		<table class=" editetable inputin tipsrighttable">
			<tr>
       			<td>
              		<div class="innerinputwrap innermiddle"> 
	                    <p class=" ttleft tt">父节点： </p>
	                    <p class="rightinput" style="line-height: 34px;"> 
                      		<label id="parentName" name="parentName">${project.projectName}</label>
                      	</p>
                 	</div>
            	</td>
       		</tr>
     		<tr>
          		<td>
                	<div class="innerinputwrap innermiddle"> 
	                    <p class=" ttleft tt">组团名称：</p>
	                    <p class="rightinput"> 
	                        <input name="groupName" class="input_txt" type="text" maxlength="50" value="${premises.groupName}" valid='true' />
	                    </p>
	                    <p class="tip red">*请输入正确名称 </p>
              		</div>
        		</td>
      		</tr>
           	
         	
            <tr>
         		<td>
                    <div class="innerselectwrap innermiddle "> 
                        <p class=" ttleft tt"> 产品类型： </p>
                        <p class="rightselect hasunit"> 
                            <select class=" input_txt" name="projectType"> 
                               	<option value=""> 请选择 </option>
                               	<c:forEach var="rowEnum"   items="${projectTypes}">
								<option value="${rowEnum.no}"
									<c:if test="${rowEnum.no==premises.projectType}">selected="selected"</c:if>
									>${rowEnum.des}
								</option>
                               	</c:forEach>
                          	</select>
                            <span class="unit select"></span>
                        </p>
                       	<p class=" tip red"> *产品类型 </p>
                    </div>
                </td>
            </tr>
       		<tr>
           		<td>
               		<div class="innerinputwrap innermiddle "> 
                 		<p class=" ttleft tt"> 容积率： </p>
                    	<p class="rightinput hasunit"> 
                        	<input name="plotRatio" class="input_txt" type="text"  value="${premises.plotRatio}" valid='decimal'/>
                          	<span class="unit"></span>
                       	</p>
                      	<p class=" tip red"> *请输入正确容积率 </p>
                 	</div>
               	</td>
         	</tr>
          	<tr>
          		<td>
              		<div class="innerinputwrap innermiddle "> 
                  		<p class=" ttleft tt"> 绿化率： </p>
                      	<p class="rightinput hasunit"> 
                       		<input name="greeningRate" class="input_txt" type="text" value="${premises.greeningRate}" valid='decimal'/>
                          	<span class="unit"> % </span>
                      	</p>
                      	<p class=" tip red"> *请输入一个非负数 </p>
               		</div>
               	</td>
           	</tr>
          	<tr>
           		<td>
               		<div class="innerinputwrap innermiddle "> 
                    	<p class=" ttleft tt"> 占地面积： </p>
                     	<p class="rightinput hasunit"> 
                       		<input name="floorSpace" class="input_txt" type="text" placeholder="如76.50" value="${premises.floorSpace}"/>
                           	<span class="unit" style=" width:6em;"> 万平方米 </span>
                      	</p>
                      	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
      			</td>
        	</tr>



			<tr>
            	<td>
                	<div class="innerinputwrap innermiddle "> 
                    	<p class=" ttleft tt"> 建造进度： </p>
                       	<p class="rightinput"> 
                       		<input name="buildingSchedule" class="input_txt" type="text" placeholder="请输入" value="${premises.buildingSchedule}"/>
                       	</p>
                      	<p class=" tip red"> *请输入一个非负数 </p>
					</div>
				</td>
          	</tr>

 
          	<tr>
              	<td>
                	<div class="innerselectwrap innermiddle "> 
                  		<p class=" ttleft tt"> 交付情况： </p>
                      	<p class="rightselect hasunit"> 
                      		<select class=" input_txt" name="deliveryFlag"> 
                        		<option value=""> 请选择 </option>
                          		<c:forEach var="rowEnum"   items="${deliveryStatusEnums}">
									<option value="${rowEnum.no}"
										<c:if test="${rowEnum.no==premises.deliveryFlag}">selected="selected"</c:if>
									>${rowEnum.des}
									</option>
                             	</c:forEach>
                           	</select>
                       		<span class="unit select">  </span>
                      	</p>
                     	<p class=" tip red"> *请输入正确交付情况</p>
                	</div>
            	</td>
        	</tr>
            <tr>
                <td>
                    <div class="innerselectwrap innermiddle "> 
                        <p class=" ttleft tt"> 装修标准： </p>
                        <p class="rightselect hasunit"> 
                            <select id="renovationType" name="renovationType" class=" input_txt" onchange="renovationTypeChange()" > 
                               <c:forEach var="rowEnum"   items="${renovationTypeEnums}">
						<option value="${rowEnum.no}" 
						<c:if test="${rowEnum.no==premises.renovationType}">selected="selected"</c:if>>${rowEnum.des}</option>
                               </c:forEach>
				</select>
                            <span class="unit select">  </span>
                        </p>
                        <p class=" tip red"> *请输入正确城市 </p>
                    </div>
                </td>
                
            </tr>
            <tr id="renovationDesc" <c:if test="${premises.renovationType!=2}">style="display: none"</c:if>>
                <td> 
                    <div class="innerinputwrap innermiddle"> 
                        <p class=" ttleft tt"> &nbsp; </p>
                        <p class="rightinput"> 
                            <input maxlength="50" name="renovationDesc" value="${premises.renovationDesc}"  class="input_txt" type="text" placeholder="请输入其它装修标准"/>
                        </p>
                        <p class=" tip red"> *请输入正确 </p>
                    </div>
                </td>
                
            </tr>
          	<tr>
          		<td>
              		<div class="innerselectwrap innermiddle "> 
                     	<p class=" ttleft tt"> 销售情况： </p>
                     	<p class="rightselect hasunit"> 
                       		<select class=" input_txt" name="salesStatus"> 
                           		<option value=""> 请选择 </option>
                              	<c:forEach var="rowEnum"   items="${salesStatusEnums}">
									<option value="${rowEnum.no}"
										<c:if test="${rowEnum.no==premises.salesStatus}">selected="selected"</c:if>
										>${rowEnum.des}
										</option>
                             	</c:forEach>
                         	</select>
                      		<span class="unit select">  </span>
                       	</p>
                      	<p class=" tip red"> *请输入正确城市 </p>
                 	</div>
           		</td>
       		</tr>
   		</table>
  	</div>

	<div class="maintt">静态销售信息<a class="power open"></a> </div>
	<div class="editetablewrap">
         	<table class=" editetable inputin tipsrighttable">
           	<tr>
               	<td> 
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt">分期名：</p>
                       	<p class="rightinput"> 
                           	<input name="staginName" id="staginName" class="input_txt" type="text" placeholder=" 请输入分期名" maxlength="200" value="${premisesPmo.staginName}"/>
                       	</p>
                       	<p class=" tip red"> *请输入正确名称 </p>
                   	</div>
        		</td>
           	</tr>
           	 <tr>
             	<td>
                	<div class="innerinputwrap innermiddle "> 
                 		<p class=" ttleft tt">总户数： </p>
                   		<p class="rightinput"> 
							<input name="householdsTotal" class="input_txt" type="text" placeholder="请输入" value="${premises.householdsTotal}" valid='number' />
                     	</p>
                     	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
              	</td>
         	</tr>
         	
         	 <tr>
           		<td>
               		<div class="innerinputwrap innermiddle "> 
                  		<p class=" ttleft tt"> 车位数： </p>
                     	<p class="rightinput hasunit"> 
                       		<input name="carportTotal" class="input_txt" type="text" placeholder="请输入" value="${premises.carportTotal}" valid='number' />
                       		<span class="unit"> 个 </span>
                  		</p>
                      	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
              	</td>
          	</tr>
           	 <tr>
             	<td>
                	<div class="innerinputwrap innermiddle "> 
                 		<p class=" ttleft tt"> 车位配比： </p>
                   		<p class="rightinput"> 
							<input name="carportMatching" class="input_txt" type="text" placeholder="请输入" value="${premises.carportMatching}"/>
                     	</p>
                     	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
              	</td>
         	</tr>
         	
         	 <tr>
             	<td>
                	<div class="innerinputwrap innermiddle "> 
                 		<p class=" ttleft tt">自持面积： </p>
                   		<p class="rightinput hasunit"> 
							<input name="ownArea" class="input_txt" type="text" placeholder="请输入" value="${projectPremisesInfo.ownArea}" valid='decimal'/>
							<span class="unit" style=" width:6em;">万平方米 </span>
                     	</p>
                     	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
              	</td>
         	</tr>
         	
         	 <tr>
             	<td>
                	<div class="innerinputwrap innermiddle "> 
                 		<p class=" ttleft tt">栋数： </p>
                   		<p class="rightinput hasunit"> 
							<input class="input_txt" type="text" placeholder="请输入" name="numberOfBuildi" value="${premisesPmo.numberOfBuildi}" valid='number'/>
							<span class="unit">栋 </span>
                     	</p>
                     	<p class=" tip red"> *请输入一个非负数 </p>
                 	</div>
              	</td>
         	</tr>
         	
         	<tr>
             	<td>
             	   <div class="innerinputwrap innermiddle "> 
                               		<div class=" ttleft tt"> 地上机动车位： </div>
                                 	<div class="rightinput hasunit"> 
                                    	<input class="input_txt" type="text" name="groundMotor" value="${projectPremisesInfo.groundMotor}" valid='number'/>
                                   		<span class="unit"> 个 </span>
                                  	</div>
                                  	<div class=" tip red"> *请输入正确地上机动车位</div>
                   </div>
             	</td>
         	</tr>
         	
         	<tr>
             	<td>
             	  <div class="innerinputwrap innermiddle "> 
                                	<div class=" ttleft tt"> 地下机动车位： </div>
                                	<div class="rightinput hasunit"> 
                                    	<input class="input_txt" type="text" name="undergroundMotor" value="${projectPremisesInfo.undergroundMotor}" valid='number' />
                                    	<span class="unit"> 个 </span>
                                  	</div>
                                  	<div class=" tip red"> *请输入正确地下机动车位</div>
                 </div>
             	</td>
         	</tr>
         	
         	<tr>
             	<td>
             	<div class="innerinputwrap innermiddle "> 
                                 	<div class=" ttleft tt"> 地上非机动车位： </div>
                                  	<div class="rightinput hasunit"> 
                                     	<input class="input_txt" type="text" name="groundNonMotor" value="${projectPremisesInfo.groundNonMotor}" valid='number' />
                                   		<span class="unit"> 个 </span>
                                  	</div>
                                 	<div class=" tip red"> *请输入正确地上非机动车位</div>
                </div>
             	</td>
         	</tr>
         	
         	<tr>
             	<td>
             	  <div class="innerinputwrap innermiddle "> 
                                 	<div class=" ttleft tt"> 地下非机动车位： </div>
                                  	<div class="rightinput hasunit"> 
                                    	<input class="input_txt" type="text" name="undergroundNonMotor" value="${projectPremisesInfo.undergroundNonMotor}" valid='number' />
                                   		<span class="unit"> 个 </span>
                                	</div>
                                	<div class=" tip red"> *请输入正确地下非机动车位</div>
                   </div>
             	</td>
         	</tr>
         	
         	<tr>
             	<td>
             	  <div class="innerinputwrap innermiddle "> 
                                 	<div class=" ttleft tt"> 可售面积： </div>
                                  	<div class="rightinput hasunit"> 
                                    	<input name="housingArea" class="input_txt" type="text" value="${projectPremisesInfo.housingArea}" valid='decimal'/>
                         	            <span class="unit" style=" width:6em;"> 万平方米 </span> 
                                	</div>
                                	<div class=" tip red"> *请输入正确地下非机动车位</div>
                   </div>
             	</td>
         	</tr>
         	                     	
            <tr>
             	<td>            	             	
                <div class="innerinputwrap innermiddle "> 
                                  	<div class=" ttleft tt"> 地上可售面积： </div>
                                  	<div class="rightinput hasunit"> 
                                   		<input name="groundArea" class="input_txt" type="text" value="${projectPremisesInfo.groundArea}" valid='decimal'/>
                                     	<span class="unit" style=" width:6em;"> 万平方米 </span>
                                  	</div>
                </div>
               </td>
         	</tr>
         	<tr>
             	<td>  
                <div class="innerinputwrap innermiddle "> 
                                	<div class=" ttleft tt"> 地下可售面积： </div>
                                   	<div class="rightinput hasunit"> 
                                     	<input name="undergroundArea" class="input_txt" type="text" value="${projectPremisesInfo.undergroundArea}" valid='decimal'/>
                                     	<span class="unit" style=" width:6em;">万平方米 </span>
                                   	</div>
            	</div>              	
         	  </td>
         	</tr>
   
         	<tr>
         	   <td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 可售套数： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="salableNumber" value="${premisesPmo.salableNumber}" valid='number'/>
                       		<span class="unit">套 </span>
                      	</div>
                	</div>
          		</td>
         	</tr>
         	
         	<tr>
         	   <td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 目标销售均价： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="targetAveragPrice" value="${premisesPmo.targetAveragPrice}" valid='decimal'/>
                       		<span class="unit">万元 </span>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 生效时间： </p>
                     	<div class="rightinput hasunit"> 
                     	<%-- <fmt:formatDate value="${project.startTime}" pattern="yyyy-MM-dd"/> --%>
                       		<input class="input_txt" type="text" name="targetAveragPriceTime" onclick="WdatePicker()" value="<fmt:formatDate value="${premisesPmo.targetAveragPriceTime}" pattern="yyyy-MM-dd"/>" readonly="readonly"/>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 版本： </p>
                     	<div class="rightinput hasunit"> 
                       		<select class=" input_txt" name="targetAveragPriceVersion"> 
                       		    <option value=""> 请选择 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='拓展版'}">selected="selected"</c:if> value="拓展版">拓展版 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='启动会版'}">selected="selected"</c:if> value="启动会版">启动会版 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='方案版'}">selected="selected"</c:if> value="方案版">方案版 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='施工图版'}">selected="selected"</c:if> value="施工图版">施工图版 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='结算版'}">selected="selected"</c:if> value="结算版">结算版 </option>
                               	<option <c:if test="${premisesPmo.targetAveragPriceVersion=='经营计划版'}">selected="selected"</c:if> value="经营计划版">经营计划版 </option>
                          	</select>
                      	</div>
                	</div>
          		</td>
         	</tr>
          <tr>
         	   <td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 车位目标销售均价： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="targetPriceOfParkinSpace" value="${premisesPmo.targetPriceOfParkinSpace}" valid='decimal'/>
                       		<span class="unit">万元 </span>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 生效时间： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="targetPriceOfParkinSpaceTime" value="<fmt:formatDate value="${premisesPmo.targetPriceOfParkinSpaceTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker()" readonly="readonly"/>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 版本： </p>
                     	<div class="rightinput hasunit"> 
                       		<select class=" input_txt" name="targetPriceOfParkinVersion"> 
                               	<option value=""> 请选择 </option>
                                <option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='拓展版'}">selected="selected"</c:if> value="拓展版">拓展版 </option>
                               	<option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='启动会版'}">selected="selected"</c:if> value="启动会版">启动会版 </option>
                               	<option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='方案版'}">selected="selected"</c:if> value="方案版">方案版 </option>
                               	<option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='施工图版'}">selected="selected"</c:if> value="施工图版">施工图版 </option>
                               	<option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='结算版'}">selected="selected"</c:if> value="结算版">结算版 </option>
                               	<option <c:if test="${premisesPmo.targetPriceOfParkinVersion=='经营计划版'}">selected="selected"</c:if> value="经营计划版">经营计划版 </option>
                          	</select>
                      	</div>
                	</div>
          		</td>
         	</tr>
         	         	<tr>
         	   <td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 目标货值： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="targetValue" value="${premisesPmo.targetValue}" valid='decimal'/>
                       		<span class="unit">万元 </span>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 生效时间： </p>
                     	<div class="rightinput hasunit"> 
                       		<input class="input_txt" type="text" name="targetValueTime" value="<fmt:formatDate value="${premisesPmo.targetValueTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker()" readonly="readonly"/>
                      	</div>
                	</div>
          		</td>
          		<td>
          		    <div class="innerinputwrap innermiddle mt10 "> 
                      	<p class=" ttleft tt"> 版本： </p>
                     	<div class="rightinput hasunit"> 
                       		<select class=" input_txt" name="targetValueVersion"> 
                               	<option value=""> 请选择 </option>
                                <option <c:if test="${premisesPmo.targetValueVersion=='拓展版'}">selected="selected"</c:if> value="拓展版">拓展版 </option>
                               	<option <c:if test="${premisesPmo.targetValueVersion=='启动会版'}">selected="selected"</c:if> value="启动会版">启动会版 </option>
                               	<option <c:if test="${premisesPmo.targetValueVersion=='方案版'}">selected="selected"</c:if> value="方案版">方案版 </option>
                               	<option <c:if test="${premisesPmo.targetValueVersion=='施工图版'}">selected="selected"</c:if> value="施工图版">施工图版 </option>
                               	<option <c:if test="${premisesPmo.targetValueVersion=='结算版'}">selected="selected"</c:if> value="结算版">结算版 </option>
                               	<option <c:if test="${premisesPmo.targetValueVersion=='经营计划版'}">selected="selected"</c:if> value="经营计划版">经营计划版 </option>
                          	</select>
                      	</div>
                	</div>
          		</td>
         	</tr>
   		</table>
	</div>

	<div class="maintt">组团图片<a class="power open"></a> </div>
	<div class="editetablewrap"> 
		<table class=" editetable inputin tipsrighttable">
			<tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 项目Logo： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_logoUrl_div"> 
                          		<a class="add"><input onchange="ajaxfile('project_logoUrl_div',this)" type="file" />  </a>
                              	<c:forEach var="logo"   items="${logoList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${logo}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 交通图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_traffiDiagra_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_traffiDiagra_div',this)" type="file" />  </a>
                              	<c:forEach var="traffiDiagra"   items="${traffiDiagraList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${traffiDiagra}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 周边图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_aroundSupporDiagra_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_aroundSupporDiagra_div',this)" type="file" />  </a>
                              	<c:forEach var="aroundSupporDiagra"   items="${aroundSupporDiagraList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${aroundSupporDiagra}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 总平图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_masterDiagra_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_masterDiagra_div',this)" type="file" />  </a>
                              	<c:forEach var="masterDiagra"   items="${masterDiagraList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${masterDiagra}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 效果图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_impreDrawing_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_impreDrawing_div',this)" type="file" />  </a>
                              	<c:forEach var="impreDrawing"   items="${impreDrawingList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${impreDrawing}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 样板图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_templateDrawing_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_templateDrawing_div',this)" type="file" />  </a>
                              	<c:forEach var="templateDrawing"   items="${templateDrawingList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${templateDrawing}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
             <tr>
         		<td>
             		<div class="innerinputwrap innermiddle"> 
                 		<p class=" ttleft tt"> 实景图片： </p>
                       	<div class="uploadimg"> 
                   			<p class="uploadimgtt">已上传 0 张图片</p>
                           	<div class="inner mt10" id="project_realDiagra_div"> 
                          		<a class="add">  <input onchange="ajaxfile('project_realDiagra_div',this)" type="file" />  </a>
                              	<c:forEach var="realDiagra"   items="${realDiagraList}">
									<a class="imgblock" onclick='showImg(this)'>
                               			<img height="108px" width="108px" src="${realDiagra}" />
                                      	<em class=" close" onclick="removeImg(this)"></em>
									</a>
                                 </c:forEach>
                            </div>
                   			<p class=" gray"> 建议尺寸：640 x 640 像素；  </p>
                        </div>
                     </div>
                 </td>
             </tr>
   		</table>
  	</div>
  	
  	
	
	


	
	<div class="downbtnwrap">
		<a class=" btn btn_blue" onclick="savaData()"> 保存 </a>
		<a class=" btn btn_white ml50" onclick="backProject()"> 返回 </a>
	</div>
</div>
<input type="hidden" name="projectId" value="${project.id}" />
<input type="hidden" name="id" value="${premises.id}"/>
<input type="hidden" name="projectInfoId" value="${projectPremisesInfo.id}" />
<input type="hidden" name="premisesId" value="${premises.id}" id="idKey" />
<input type="hidden" name="premisesPmoId" value="${premisesPmo.id}"/>
<input type="hidden" name="logoUrl" id="logoUrl" value=""/>
<input type="hidden" name="traffiDiagra" id="traffiDiagra" value=""/>
<input type="hidden" name="aroundSupporDiagra" id="aroundSupporDiagra" value=""/>
<input type="hidden" name="masterDiagra" id="masterDiagra" value=""/>
<input type="hidden" name="impreDrawing" id="impreDrawing" value=""/>
<input type="hidden" name="templateDrawing" id="templateDrawing" value=""/>
<input type="hidden" name="realDiagra" id="realDiagra" value=""/>
<input type="hidden" name="industDataObj" id="industData" />
<input type="hidden" name="srpSale" id="srpSale"/>
<input type="hidden" name="srpReturn" id="srpReturn" />
<input type="hidden" name="srpDynamic" id="srpDynamic" />

</form>


<script>
	var industTime = new Array();
    function backProject(){
    	var url="${jypath}/estate/project/index";
    	window.location.href=url;
    }
    $(function () {
    	var select="";
    	var industMarkValue = "";
    	var industMarkEnums=${industMarkEnums};
    	var industDatas = ${industDatas};
    	industTime=${industTime}; 
    	
		var getEnums = function(val){
			select="<select class='b_input_txt' name='industMark'> " ;
    		select+="<option value=''> 请选择 </option>";
  			$.each(industMarkEnums, function(index,value){
  				if(val && value.id==val){
  					industMarkValue = value;
          			select+="<option selected='selected' value='"+value.id+"'> "+value.codeName+" </option>";
          		}else{
          			select+="<option value='"+value.id+"'> "+value.codeName+" </option>";
          		}
  			})
    		select+="</select>";
		}
    	
        //隐藏展示Panel
        $(".maintt").click(function () {
            if ($(this).next(".editetablewrap").is(":hidden")) {
                $(".editetablewrap").hide();
                $(this).next(".editetablewrap").show();
                $(".power").removeClass("open");
                $(this).find(".power").addClass("open");
            } else {
                $(".editetablewrap").hide();
                $(".power").removeClass("open");
            }
        });
   
        
    
        
        $("#code_type_add").on("click", function(){
        	getEnums();
        	getIndustDatas();
        	
        });
    });
    
    function updateCancel(cal){
    	$("#"+cal).remove();
    }
    var f = true;
    function getData(){
    	var valid = $(".b_input_txt");
    	for(var i=0;i<valid.length;i++){
    		 var value = valid.eq(i).val();
    		 if(valid.eq(i).attr("valid")=='number'){
     			if(value!=null&&value!=""){
     				var reg = /^\+?(0|[1-9][0-9]*)$/;
     				if(!reg.test(value)){
         				valid.eq(i).focus();
     					layer.tips("请输入一个整数!",valid.eq(i));
     					f = false;
     					return;
     				}
     			}
     		}else if(valid.eq(i).attr("valid")=='decimal'){
    			var reg = /^\d+(.\d{0,6})?$/;
    			if(value!=null&&value!=""){
    				if(!reg.test(value)){
    	    			valid.eq(i).focus();
      					layer.tips("请输入一个数字,可保留6位小数!",valid.eq(i));
      					f = false;
      					return;
      				}
    			}
    		}
    	}
    	f = true;
    	var arr = new Array();
    	var b ={};
    	$("#baseTypeTable tbody tr .b_input_txt").each(function(index){  
   			 var o = {}
   	         o.name=$(this).attr("name");
   	         o.value=$(this).val();
   	         arr.push(o);
        }); 
    	b.data=arr;
    	$("#industData").val(JSON.stringify(b));
    }
    
    function test(obj,value){
    	 industTime[value-1]=$(obj).val();
    	 var timeList = $("input[name=effectStartTime"+value+"]");
    	 for(var i=0;i<timeList.length;i++){
    		 timeList.eq(i).attr("value",$(obj).val());
    	 }
    
    }
    
 
  
  
    
    function savaData(){
    	var valid = $(".input_txt");
    	for(var i=0;i<valid.length;i++){
    		var value = valid.eq(i).val();
    		if(valid.eq(i).attr("valid")=='true'){
    			if(value==null||value==""||value=="-1"){
    				valid.eq(i).focus();
    				layer.tips('必填项', valid.eq(i));
    				return;
    			}
    		}else if(valid.eq(i).attr("valid")=='number'){
    			if(value!=null&&value!=""){
    				var reg = /^\+?(0|[1-9][0-9]*)$/;
    				if(!reg.test(value)){
        				valid.eq(i).focus();
    					layer.tips("请输入一个整数!",valid.eq(i));
    					return;
    				}
    			}
    		}else if(valid.eq(i).attr("valid")=='decimal'){
    			var reg = /^\d+(.\d{0,6})?$/;
    			if(value!=null&&value!=""){
    				if(!reg.test(value)){
    	    			valid.eq(i).focus();
      					layer.tips("请输入一个数字,可保留6位小数!",valid.eq(i));
      					return;
      				}
    			}
    		}
		}
    	getData();
    	if(!f)return;
    	initFormImg();
    	//console.log($("#premises_form").serialize());
    	$.ajax({
    		type: 'post',
            url: "${jypath}/estate/projectPremises/edit",
    	    data: $("#premises_form").serialize(),
    	    dataType:'json',
    	    success: function(res){
    	    	if(res.res=="1"){
    	    		var idKey=$("#idKey").val();
    	    		var successMsg="";
    	    		if(idKey!=""){
    	    			successMsg="修改成功";
    	    		}else{
    	    			successMsg="新增成功";
    	    		}
    	    		layer.confirm(successMsg, {
    	    		   btn: ['确定'] //按钮
    	    		}, function(){
    	    			backProject();
    	    		});
    	    	}else if(res.res=="100"){
    	    		layer.alert("权限不足！")
    	    	}else{
    	    		layer.alert(res.resMsg);
    	    	}
    	    }
    	}); 
    }
    
    function ajaxfile(imgDivId,obj){
    	console.log("进入文件上传方法");
	    $("input[type='file']").each(function(index,obj){
	    	 $(obj).attr("name","");
	 	     $(obj).attr("id","");
	    });
    	$(obj).attr("name","file");
	    $(obj).attr("id","file");
	    var filePath=$("#file").val();
	    console.log("文件上传路径："+filePath);
	    if(!/\.(gif|jpg|jpeg|png|bmp|GIF|JPG|PNG|BMP)$/.test(filePath)){
	        alert('提示','您上传的图片格式不正确');
	        return;
	    }
	    console.log("文件上传参数验证通过，开始上传......");
	    $.ajaxFileUpload ({
			url:'${jypath}/common/file/uploadFile?type=1',
			secureuri:false,
			fileElementId:"file",
			dataType: 'json',
			success: function (data, status) {
				var url=data.url;
				var result=data.result;
				if(result!="0"){
					layer.alert("文件上传成功");
					//创建img + imgName
					url=url+"?fileName="+data.fileName;
					var imgHtml='<a class="imgblock" onclick="showImg(this)"> <img height="108px" width="108px" src="'+url+'" /> <em class=" close" onclick="removeImg(this)"> </em> </a>';
					$("#"+imgDivId).append(imgHtml);
					queryImages();
				}else{
					layer.alert("文件上传失败");
				}
				
			},
			error: function (data, status, e){
				layer.alert("网络错误");
	        }
		});
    }
    
    //删除图片
    function removeImg(obj){
    	$(obj).parent().remove();
    }
    
    function queryImages(){
		//图片数量统计
		var array = new Array();
		array.push('#project_logoUrl_div');
		array.push('#project_traffiDiagra_div');
		array.push('#project_aroundSupporDiagra_div');
		array.push('#project_masterDiagra_div');
		array.push('#project_impreDrawing_div');
		array.push('#project_templateDrawing_div');
		array.push('#project_realDiagra_div');
		for(ob in array){
			$(array[ob]).prev().html("已上传"+$(array[ob] +" img").length+"张图片");
		}
    }
    
    function initFormImg(){
    	var logoUrl = getImageUrl("logoUrl");
    	var traffiDiagra = getImageUrl("traffiDiagra");
    	var aroundSupporDiagra = getImageUrl("aroundSupporDiagra");
    	var masterDiagra = getImageUrl("masterDiagra");
    	var impreDrawing = getImageUrl("impreDrawing");
    	var templateDrawing = getImageUrl("templateDrawing");
    	var realDiagra = getImageUrl("realDiagra");
    	$("#logoUrl").val(logoUrl);
    	$("#traffiDiagra").val(traffiDiagra);
    	$("#aroundSupporDiagra").val(aroundSupporDiagra);
    	$("#masterDiagra").val(masterDiagra);
    	$("#impreDrawing").val(impreDrawing);
    	$("#templateDrawing").val(templateDrawing);
    	$("#realDiagra").val(realDiagra);
    }
    
  //获取图片url字符串用;隔开
    function getImageUrl(name){
    	var urlStr="";
    	var divName="project_"+name+"_div";
    	$("#"+divName+" img").each(function(index,obj){
    		var url=$(obj).attr("src");
    		if(index==0){
    			urlStr=url;
    		}else{
    			urlStr=urlStr+","+url;
    		}
    	});
    	return urlStr;
    }
    
    //切换单选按钮
    function clickSelect(currObj,name){
    	$("em[name='"+name+"Check']").each(function(index,obj){
    		$(obj).removeClass("icon_radio_checked");
    	});
    	$(currObj).addClass("icon_radio_checked");
    	var checkValue=$(currObj).attr("checkValue")
    	$("#"+name).val(checkValue);
    	
    }
    
    function renovationTypeChange(){
    	var values = $("#renovationType").val();
    	if(values==2){
    		$("#renovationDesc").show();
    	}else{
    		$("#renovationDesc").hide();
    	}
    }
</script>
  <script type="text/javascript" src="${jypath}/static/js/strip.min.js?v=${jsVersion}"></script>
</body>
</html>
